package admin

import (
	"news_for_deepseek_interface/controller"
	adminService "news_for_deepseek_interface/service/admin"

	"github.com/gin-gonic/gin"
)

func Routers(c *gin.Context) {
	//1. 获取管理员ID
	adminId := c.GetInt("admin_id")

	//2. 调用服务层处理登录逻辑
	response, err := adminService.GetUserRoles(adminId)
	if err != nil {
		controller.Fail(c, controller.BusinessError, err.Error())
		return
	}

	//3. 返回成功响应
	controller.Success(c, response)
}
